<!DOCTYPE html>
<html>
<head>
    <title>维护计划变更记录</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <Card v-show="showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="moldMaintenancePlanDelayApplyParam" :rules="ruleValidate" :label-width="80">
            <Row>
                <i-col span="11" >
                    <Form-item label="延期结束日期" prop="newPlanTime">
                        <Date-picker type="date" v-model="moldMaintenancePlanDelayApplyParam.changeTime"
                                     placeholder="延期结束时间"></Date-picker>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="所需资源" prop="resources">
                        <i-input type="textarea" v-model="moldMaintenancePlanDelayApplyParam.resources"
                                 placeholder="所需资源"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="变更原因" prop="changeReason">
                        <i-input type="textarea" v-model="moldMaintenancePlanDelayApplyParam.changeReason"
                                 placeholder="变更原因"></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="备注" prop="remark">
                        <i-input type="textarea" v-model="moldMaintenancePlanDelayApplyParam.remark" placeholder="备注"></i-input>
                    </Form-item>
                </i-col>
            </Row>
        </i-form>
    </Card>
</div>
<script>
    let vm = new Vue({
        el: '#rrapp',
        data: {
            showList: true,
            title: null,
            moldMaintenancePlanDelayApplyParam:{
                ticketId: '',
                changeReason: '',
                resources: '',
                remark: '',
                changeTime: ''
            },
            ruleValidate: {
                name: [
                    {required: true, message: '名称不能为空', trigger: 'blur'}
                ]
            },
            q: {
                name: ''
            }
        },
        methods: {
            query: function () {
                vm.reload();
            },
            add: function () {
                vm.showList = false;
                vm.title = "新增";
                vm.moldMaintenancePlanDelayApplyParam = {
                    ticketId: '',
                    changeReason: '',
                    resources: '',
                    remark: '',
                    changeTime: ''
                };
            },
            GMTToStr: function(time){
                var date = new Date(time)
                return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
            }
        }
    });
    function getFormDates() {
        if(vm.moldMaintenancePlanDelayApplyParam.changeTime){
            vm.moldMaintenancePlanDelayApplyParam.changeTime = vm.GMTToStr(vm.moldMaintenancePlanDelayApplyParam.changeTime);
        }
        return vm.moldMaintenancePlanDelayApplyParam;
    }
</script>
</body>
</html>
